import network from '../../utils/network.js';
//获取应用实例
var app = getApp()
Page({
    data: {
      markers: [{
        latitude: 0,
        longitude: 0,
        name: '',
        desc: ''
      }],
    covers: [{
      
    }]
  },
  onLoad: function (options) {
    var that = this;
    var addr = options.addr;
    var data = {
      "addr":addr
    };
    var message = "正在获取定位";
    network.requestLoading('http://jbc.com/api/User/get_localtion', data, message, function (res) {
      if (res.code > 0) {
        wx.openLocation({
          latitude: res.data.lat,
          longitude: res.data.lng,
          name: addr,
          scale: 1
        });  
      } else {
          that.setData({
            hasMoreData: false
          });
        } 
    }, function (res) {
      wx.showToast({
        title: '加载数据失败',
      })

    })

    
  },
})
